#pragma once

#define DIRECTINPUT_VERSION 0x0800
#include <Windows.h>
#include <dinput.h>
#include <dinputd.h>

class CJoystick
{
public:
	CJoystick(void);
	virtual ~CJoystick(void);

public:
	bool	initJoystick(HWND hWnd);
	void	destroy(void);
	bool	acquire(void);
	void	update(void);
	void	get_joystick_state(void);

private:
	friend	BOOL CALLBACK enumJoysticksCallback(const DIDEVICEINSTANCE* pInstance, VOID* pvRef);
	friend	BOOL CALLBACK enumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* pvRef);

private:
	
private:
	LPDIRECTINPUT8			m_pDInput;
	LPDIRECTINPUTDEVICE8	m_pDevJoystick;
};
